#pragma once


unsigned char GetBits(unsigned char in, int from, int to);
int GetBits(unsigned __int64 source, int from, int to);
int GetBits(int source, int from, int to);
void SetBits(unsigned __int64& dest, int from, int to, int val);
void SetBits(int& dest, int from, int to, int val);
void SetBits(unsigned char& dest, int to,int from,  unsigned char val);
short GetInt16(unsigned char byte0, unsigned char byte1);
int GetInt32(unsigned char byte0, unsigned char byte1, unsigned char byte2, unsigned char byte3);
void SetInt16(unsigned char& byte0, unsigned char& byte1, short value);
void SetInt32(unsigned char& byte0, unsigned char& byte1, unsigned char& byte2, unsigned char& byte3, int value);

void IntToByte(unsigned char* data, int value);
int ByteToInt(unsigned char* data);
